﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using Ent.Inscripcion.Core.Core;
using Ent.Inscripcion.Core.Administracion;

namespace Ent.Inscripcion.Presentacion
{
    public partial class Principal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session.Count > 0)
                {
                    var estudiante = Session["Estudiante"] as Estudiante;
                    lblDatosUsuarior.Text = string.Format("{0} {1}", estudiante.Nombre, estudiante.Apellido);
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }
            }
            catch (Exception ex)
            {
                Util.RegistarLog(ex);
            }
        }
        protected void btnSalir_Click(object sender, DirectEventArgs e)
        {
            try
            {
                Session.RemoveAll();
                Session.Abandon();
                Response.Redirect("Default.aspx");
            }
            catch (Exception ex)
            {
                Util.RegistarLog(ex);
            }
        }
    }
}